/*
Copyright (C) 1996-1997 Id Software, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/

#include "fxVSIncludes.fx"

struct VS_SPRITE
{
	float4 Position: POSITION;
	float2 TexCoord: TEXCOORD;
};

struct PS_SPRITE
{
	float4 Position : SV_POSITION;
	float2 TexCoord: TEXCOORD;
};


#ifdef VERTEXSHADER
PS_SPRITE SpriteVS (VS_SPRITE vs_in)
{
	PS_SPRITE vs_out;

	vs_out.Position = mul (EntityMatrix, mul (LocalMatrix, vs_in.Position));
	vs_out.TexCoord = vs_in.TexCoord;

	return vs_out;
}
#endif


#ifdef PIXELSHADER
Texture2D spriteTexture : register(TEXTURE_SLOT_SPRITES);

float4 SpritePS (PS_SPRITE ps_in) : SV_TARGET0
{
	float4 diff = spriteTexture.Sample (surfSampler, ps_in.TexCoord);
	return float4 (diff.rgb, diff.a * Alpha);
}
#endif
